﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Shop.Core.Domain.Common;

namespace Shop.Core.Domain.Orders
{
    public interface IOrderFlowNode
    {
        /// <summary>
        /// 是否需要继续支付
        /// </summary>
        bool CanPay(Order order);

        void Pay(Order order, Money money);

        /// <summary>
        /// 是否能修改
        /// </summary>
        bool CanEdit(Order order);

        /// <summary>
        /// 开始编辑订单
        /// </summary>
        /// <param name="order"></param>
        void BeginEdit(Order order);

        /// <summary>
        /// 结束编辑
        /// </summary>
        /// <param name="order"></param>
        void EndEdit(Order order);

        /// <summary>
        /// 判定能否取消订单
        /// </summary>
        /// <param name="order"></param>
        /// <returns></returns>
        bool CanCancel(Order order);

        /// <summary>
        /// 取消订单
        /// </summary>
        /// <param name="order"></param>
        void Cancel(Order order);

        /// <summary>
        /// 是否允许联系客户(临时hold订单)
        /// </summary>
        /// <param name="order"></param>
        /// <returns></returns>
        //bool CanContactCustomer(Order order);

        /// <summary>
        /// 处理订单，如果符合条件，状态自动转到下一个状态
        /// </summary>
        /// <param name="order"></param>
        /// <returns></returns>
        bool FlowToNext(Order order);
    }
}
